package com.example.cainiao.Controller;

import com.example.cainiao.User;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import io.swagger.annotations.ApiResponse;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/h")
public class Swagger {
    @GetMapping("/hello")
    public String hello(User username){
        return "hello";
    }
    @PostMapping("/getUser")
    public User getUser(){
        return new User();
    }
    @ApiOperation("/hello2方法，这个方法可以返回 ss")
    @GetMapping("/hello2")
    public String hello2(@ApiParam("传入用户对象")User user){
        return "ss";
    }
}
